package com.mz.ozy.mvp.presenter;


import android.content.Context;

import com.mz.ozy.base.BasePresenterImpl;
import com.mz.ozy.bean.OrderDetailBean;
import com.mz.ozy.mvp.model.AppealModel;
import com.mz.ozy.mvp.view.AppealContract;
import com.mz.ozy.net.MyObserver;
import com.mz.ozy.utils.RxUtil;

import okhttp3.ResponseBody;

/**
 * Created by administrator on 2018/12/3.
 */
public class AppealPresenter extends BasePresenterImpl<AppealContract.View> implements AppealContract.Presenter {

    private AppealModel mModel;

    public AppealPresenter() {
        mModel = new AppealModel();
    }


    @Override
    public void onSuggest(Context context, String orderid, String messge, String submitImg, String userType) {
        mModel.onSuggest(context, orderid, messge, submitImg, userType)
                .compose(RxUtil.rxSchedulerHelper(mView.<ResponseBody>bindToLifecycle()))
                .subscribe(new MyObserver<OrderDetailBean>(mView) {
                    @Override
                    public void onSuccesss(OrderDetailBean bean) {
                        mView.onSuggestSuccess(bean);
                    }
                });
    }
}
